﻿/******************************************************************************
  * Copyright  2023 - LiuKuan
  * All right reserved. See COPYRIGHT for detailed Information.
  *
  * @file       GroundedFactGroup.h
  * @brief      接地极数据
  * @author     <807874484@qq.com>
  * @date       2024/07/19
  * @history
  *****************************************************************************/

#ifndef GROUNDEDFACTGROUP_H
#define GROUNDEDFACTGROUP_H

#include <QObject>

#include "Fact/Fact.h"
#include "Fact/FactGroup.h"
#include "Stdafx.h"

class GroundedFactGroup : public FactGroup
{
    Q_OBJECT
    ///ID
    Q_PROPERTY(Fact* id               READ id              CONSTANT)
    ///系数
    Q_PROPERTY(Fact* factor           READ factor          CONSTANT)
    ///温度
    Q_PROPERTY(Fact* temp             READ temp            CONSTANT)
    ///电池电压
    Q_PROPERTY(Fact* batteryVoltage   READ batteryVoltage  CONSTANT)
    ///总电阻
    Q_PROPERTY(Fact* totalResistance  READ totalResistance CONSTANT)
    ///A极电阻
    Q_PROPERTY(Fact* aPoleResistor    READ aPoleResistor   CONSTANT)
    ///B极电阻
    Q_PROPERTY(Fact* bPoleResistor    READ bPoleResistor   CONSTANT)
    ///C极电阻
    Q_PROPERTY(Fact* cPoleResistor    READ cPoleResistor   CONSTANT)
    ///D极电阻
    Q_PROPERTY(Fact* dPoleResistor    READ dPoleResistor   CONSTANT)
    ///电流
    Q_PROPERTY(Fact* current          READ current         CONSTANT)
    ///雷击次数
    Q_PROPERTY(Fact* strikeCount      READ strikeCount     CONSTANT)
    ///雷击时间
    Q_PROPERTY(Fact* strikeTime       READ strikeTime      CONSTANT)
    ///雷击电流
    Q_PROPERTY(Fact* strikeCurrent    READ strikeCurrent   CONSTANT)
    ///位置描述信息
    Q_PROPERTY(Fact* describeInfo     READ describeInfo    CONSTANT)
    ///位置描述信息起始地址
    Q_PROPERTY_AUTO(int ,describeInfoAddress);
    ///ID 系数起始地址
    Q_PROPERTY_AUTO(int ,idAndFactorAddress);
    ///终端数据起始地址
    Q_PROPERTY_AUTO(int ,dataValeAddres);
public:
    GroundedFactGroup(QObject* parent = nullptr);

    Fact* id               (void)  { return &id_; }
    Fact* factor           (void)  { return &factor_; }
    Fact* temp             (void)  { return &temp_; }
    Fact* batteryVoltage   (void)  { return &batteryVoltage_; }
    Fact* totalResistance  (void)  { return &totalResistance_; }
    Fact* aPoleResistor    (void)  { return &aPoleResistor_; }
    Fact* bPoleResistor    (void)  { return &bPoleResistor_; }
    Fact* cPoleResistor    (void)  { return &cPoleResistor_; }
    Fact* dPoleResistor    (void)  { return &dPoleResistor_; }
    Fact* current          (void)  { return &current_; }
    Fact* strikeCount      (void)  { return &strikeCount_; }
    Fact* strikeTime       (void)  { return &strikeTime_; }
    Fact* strikeCurrent    (void)  { return &strikeCurrent_; }
    Fact* describeInfo     (void)  { return &describeInfo_; }

    static const char * idFactName_;
    static const char * factorFactName_;
    static const char * tempFactName_;
    static const char * batteryVoltageFactName_;
    static const char * totalResistanceFactName_;
    static const char * aPoleResistorFactName_;
    static const char * bPoleResistorFactName_;
    static const char * cPoleResistorFactName_;
    static const char * dPoleResistorFactName_;
    static const char * currentFactName_;
    static const char * strikeCountFactName_;
    static const char * strikeTimeFactName_;
    static const char * strikeCurrentFactName_;
    static const char * describeInfoFactName_;

private:
    Fact id_;
    Fact factor_;
    Fact temp_ ;
    Fact batteryVoltage_;
    Fact totalResistance_;
    Fact aPoleResistor_;
    Fact bPoleResistor_;
    Fact cPoleResistor_;
    Fact dPoleResistor_;
    Fact current_;
    Fact strikeCount_;
    Fact strikeTime_;
    Fact strikeCurrent_;
    Fact describeInfo_;
};

#endif // GROUNDEDFACTGROUP_H







